﻿package com.pandemicode.framework.utils {
	/**
	* @author Michael Lawrence
	* @version 1.0.0
	*/
	public class RegEx {
		/**
		 * A series of methods for dealing with regular expressions.
		 */
		public function RegEx() { }
		
		/**
		 * Determines whether an email is valid.
		 * @param	email	The email address to check.
		 * @return	Returns whether the supplied email is valid.
		 */
		public static function isValidEmail(email:String):Boolean {
			var re:RegExp = new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\\b", "gi");
			return re.test(email);
		}
	}
}